with Ada.Text_Io; use Ada.Text_Io;
with Ada.Integer_Text_Io; use Ada.Integer_Text_Io;

procedure Hanoi is

   N: Integer ;

   function Recurs(N: Integer) return Integer is
   begin
      if N = 1 then
         return 1;
      else
         return (2*Recurs(N-1))+1;
      end if;
   end Recurs;

begin
   Put("Nombre de disques : ");
   Get(N);
   Put("il faut "& Integer'Image(Recurs(N))&" coups pour résoudre");
end Hanoi;
